home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shw_entranceamb.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  107 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SHW_entranceAmb.cog
  4. #
  5. # Produces random ambient cave sounds when attatched to a ghost object.
  6. # Based on code from TEO_Drops.cog by SXC.
  7. #
  8. # [TRM & SXC]  modified 12/3 by [CMG]
  9. #
  10. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  11. # ========================================================================================
  12.  
  13. symbols
  14.  
  15.     message     startup
  16.     message     crossed
  17.     message     pulse
  18.     
  19.     
  20.     surface       oncross               linkID=2
  21.     surface       oncross1              linkID=2
  22.     surface       offcross              linkID=3
  23.     surface       offcross1             linkID=3
  24.     
  25.             
  26.     sound       sndCave0=shw_amb2.wav    local
  27.     sound       sndCave1=shw_amb3.wav    local
  28.     sound       sndCave2=shw_amb4.wav    local
  29.     sound       sndCave3=shw_amb5.wav    local
  30.     sound       sndCave4=shw_amb6.wav    local
  31.     sound       sndCave5=shw_amb7.wav    local
  32.         
  33.     float       caveFreq        local
  34.     
  35.     flex        pulseTime=4.0
  36.     flex        vol=1.0
  37.     
  38. end
  39.  
  40. # ========================================================================================
  41.  
  42. code
  43.  
  44. startup:
  45.  
  46.        SetPulse(pulseTime);
  47.        return;
  48.        
  49. # ========================================================================================
  50.  
  51.  
  52.  
  53. crossed:
  54.  
  55.     If (GetSenderID() == 2)
  56.             {
  57.             SetPulse(pulseTime);
  58.             }
  59.     
  60.     If (GetSenderID() == 3)
  61.             {
  62.             SetPulse(0);
  63.             }
  64.  
  65. return;
  66. # ========================================================================================
  67.  
  68. pulse:
  69.     
  70.     caveFreq = Rand();
  71.  
  72.     if (caveFreq < 0.16)
  73.         {
  74.             PlaySoundLocal(sndCave0, vol, 1, 0, 0);
  75.         }
  76.         
  77.     if ((caveFreq > 0.16) && (caveFreq < 0.32))
  78.         {
  79.             PlaySoundLocal(sndCave1, vol, 0, 0, 0);
  80.         }
  81.         
  82.     if ((caveFreq > 0.32) && (caveFreq < 0.48))
  83.         {
  84.             PlaySoundLocal(sndCave2, vol, -1, 0, 0);
  85.         }
  86.     
  87.     if ((caveFreq > 0.48) && (caveFreq < 0.64))
  88.         {
  89.             PlaySoundLocal(sndCave3, vol, 0, 0, 0);
  90.         }
  91.     
  92.     if ((caveFreq > 0.64) && (caveFreq < 0.80))
  93.         {
  94.             PlaySoundLocal(sndCave4, vol, 1, 0, 0);
  95.         }
  96.     
  97.     if ((caveFreq > 0.80) && (caveFreq < 0.96))
  98.         {
  99.             PlaySoundLocal(sndCave5, vol, -1, 0, 0);
  100.         }
  101.         
  102.     return;
  103.     
  104. # ========================================================================================
  105.         
  106. end
  107.